package com.designpattern.FactoryMethodPattern;

/**
 * @Author yp
 * @Date 2021-05-26
 * @Description 工厂方法测试类
 **/

public class Test {
    public static void main(String[] args) {

        FoodFactory foodFactory = new ChineseFoodFactory();
        Food food = foodFactory.makeFood("饼干");
        food.show();


        // 需求变更，我要美国工厂加工的香肠
        FoodFactory foodFactory1 = new AmericanFoodFactory();
        Food food1 = foodFactory1.makeFood("香肠");
        food1.show();

    }
}

